<script>
import TabCom1 from './components/TabCom1.vue';
import TabCom2 from './components/TabCom2.vue';
import TabCom3 from './components/TabCom3.vue';
    export default{
        data(){
            return{
                currentTab:"TabCom1"
            }
        },
        components:{
            TabCom1,
            TabCom2,
            TabCom3
        }
    }
</script>

<template>
    <div>
       <button @click="currentTab = 'TabCom1'">音乐</button>
       <button @click="currentTab = 'TabCom2'">视频</button>
       <button @click="currentTab = 'TabCom3'">新闻</button>
       <keep-alive>
            <component :is="currentTab"></component>
       </keep-alive>
    </div>
</template>

<style scoped>
</style>